/*
 * Classe da apresentação inicial do jogo
 */

package booebill;

/**
 *
 * @author  druciaki
 * @author  hartmann
 */
public class TelaEntrada extends javax.swing.JFrame
{
    /*
     * Inicia a classe TelaEntrada sem argumentos
     */
    //Cria classe com os sons
    private EfeitosSonoros Efeitos = new EfeitosSonoros();
    
    public TelaEntrada()
    {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Código Gerado ">//GEN-BEGIN:initComponents
    private void initComponents()
    {
        jbStart = new javax.swing.JButton();
        jbCreditos = new javax.swing.JButton();
        jbSair = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        getContentPane().setLayout(null);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(455, 350));
        setResizable(false);
        jbStart.setBackground(new java.awt.Color(231, 238, 224));
        jbStart.setFont(new java.awt.Font("SansSerif", 1, 12));
        jbStart.setText("Start");
        jbStart.setMaximumSize(new java.awt.Dimension(70, 80));
        jbStart.setMinimumSize(new java.awt.Dimension(70, 80));
        jbStart.setPreferredSize(new java.awt.Dimension(70, 80));
        jbStart.addMouseListener(new java.awt.event.MouseAdapter()
        {
            public void mouseEntered(java.awt.event.MouseEvent evt)
            {
                jbStartMouseEntered(evt);
            }
        });
        jbStart.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                IniciaJogo(evt);
            }
        });

        getContentPane().add(jbStart);
        jbStart.setBounds(30, 130, 140, 40);

        jbCreditos.setBackground(new java.awt.Color(231, 238, 224));
        jbCreditos.setFont(new java.awt.Font("SansSerif", 1, 12));
        jbCreditos.setText("Creditos");
        jbCreditos.setMaximumSize(new java.awt.Dimension(90, 35));
        jbCreditos.setMinimumSize(new java.awt.Dimension(90, 35));
        jbCreditos.setPreferredSize(new java.awt.Dimension(90, 35));
        jbCreditos.addMouseListener(new java.awt.event.MouseAdapter()
        {
            public void mouseClicked(java.awt.event.MouseEvent evt)
            {
                jbCreditosMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt)
            {
                jbCreditosMouseEntered(evt);
            }
        });

        getContentPane().add(jbCreditos);
        jbCreditos.setBounds(40, 160, 90, 35);

        jbSair.setBackground(new java.awt.Color(231, 238, 224));
        jbSair.setFont(new java.awt.Font("SansSerif", 1, 12));
        jbSair.setText("Sair");
        jbSair.setMaximumSize(new java.awt.Dimension(60, 40));
        jbSair.setMinimumSize(new java.awt.Dimension(60, 40));
        jbSair.addMouseListener(new java.awt.event.MouseAdapter()
        {
            public void mouseEntered(java.awt.event.MouseEvent evt)
            {
                jbSairMouseEntered(evt);
            }
        });
        jbSair.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                sair(evt);
            }
        });

        getContentPane().add(jbSair);
        jbSair.setBounds(50, 190, 57, 25);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/booebill.png")));
        getContentPane().add(jLabel1);
        jLabel1.setBounds(170, 80, 270, 168);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    private void jbSairMouseEntered(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jbSairMouseEntered
    {//GEN-HEADEREND:event_jbSairMouseEntered
        Efeitos.SomSobreBotao();
    }//GEN-LAST:event_jbSairMouseEntered
    
    private void jbCreditosMouseEntered(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jbCreditosMouseEntered
    {//GEN-HEADEREND:event_jbCreditosMouseEntered
        Efeitos.SomSobreBotao();
    }//GEN-LAST:event_jbCreditosMouseEntered
        
    private void jbStartMouseEntered(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jbStartMouseEntered
    {//GEN-HEADEREND:event_jbStartMouseEntered
        Efeitos.SomSobreBotao();
    }//GEN-LAST:event_jbStartMouseEntered
        
    private void jbCreditosMouseClicked(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jbCreditosMouseClicked
    {//GEN-HEADEREND:event_jbCreditosMouseClicked
        //Chamar os creditos
        Efeitos.SomBotaoPressionado();
        this.setVisible(false);
        new Creditos().setVisible(true);
    }//GEN-LAST:event_jbCreditosMouseClicked
    
    private void sair(java.awt.event.ActionEvent evt)//GEN-FIRST:event_sair
    {//GEN-HEADEREND:event_sair
        System.exit(0);
    }//GEN-LAST:event_sair
    
    private void IniciaJogo(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_IniciaJogo
        Efeitos.SomBotaoPressionado();
        this.setVisible(false);
        new TelaJogador().setVisible(true);
    }//GEN-LAST:event_IniciaJogo
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[])
    {
        java.awt.EventQueue.invokeLater(new Runnable()
        {
            public void run()
            {
                new TelaEntrada().setVisible(true);
            }
        });
    }
    
    // Declaração de variáveis - não modifique//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JButton jbCreditos;
    private javax.swing.JButton jbSair;
    private javax.swing.JButton jbStart;
    // Fim da declaração de variáveis//GEN-END:variables
    
}
